<#include "../inc/head.html"/>
<h1>${currChannel.name}</h1>
<script src="${contextPath}js/check.js"></script>
<script>
function validata(form){
	if(document.getElementById("name").value==""){
		alert("请输入姓名");
		document.getElementById("name").focus();
		return false;
	}
	if(document.getElementById("email").value!="" && !isEmail(document.getElementById("email").value,"")){
		alert("请输入正确的邮箱");
		document.getElementById("email").select();
		return false;
	}
	if(document.getElementById("tel").value==""){
		alert("请输入联系电话");
		document.getElementById("tel").focus();
		return false;
	}
	if(document.getElementById("title").value==""){
		alert("请输入标题");
		document.getElementById("title").focus();
		return false;
	}
	if(document.getElementById("content").value==""){
		alert("请输入留言内容");
		document.getElementById("content").focus();
		return false;
	}else if(document.getElementById("content").value.length>500){
		alert("留言内容不能超过500个字符");
		document.getElementById("content").focus();
		return false;
	}
	if(document.getElementById("validatecode").value==""){
		alert("请输入验证码");
		document.getElementById("validatecode").focus();
		return false;
	}
	return true;
}
</script>  
<form name="guestbookForm" method="post" 
action="${contextPath}guestbook_save.do?siteid=${site.id}&templetPath=guestbook/guestbookSave.html" 
onsubmit="return validata(this);">
<input type="hidden" name="guestbook.siteid" value="${site.id}"/>
          <table width="710" border="0" cellpadding="0" cellspacing="1" bgcolor="#E6E6E6">
            <tr>
              <td width="150" height="30" align="right" valign="middle" bgcolor="#FFFFFF" class="lan_bwz" style="padding-right:10px">姓名：</td>
              <td height="30" align="left" valign="middle" bgcolor="#FFFFFF" style="padding-left:10px">
              <input id="name" name="guestbook.name" type="text" class="ysqgk_box2" />
                <span class="hong_wz">*</span></td>
            </tr>
            <tr>
              <td width="150" height="30" align="right" valign="middle" bgcolor="#FFFFFF" class="lan_bwz" style="padding-right:10px">性别：</td>
              <td height="30" align="left" valign="middle" bgcolor="#FFFFFF" style="padding-left:10px">
              <input type="radio" name="guestbook.sex" value="1" checked>男         
              <input type="radio" name="guestbook.sex" value="0">女
              <span class="hong_wz">*</span></td>
            </tr>
            <tr>
              <td width="150" height="30" align="right" valign="middle" bgcolor="#FFFFFF" class="lan_bwz" style="padding-right:10px">电子邮箱：</td>
              <td height="30" align="left" valign="middle" bgcolor="#FFFFFF" style="padding-left:10px">
              <input name="guestbook.email" id="email" type="text" class="ysqgk_box2" />
                </td>
            </tr>
            <tr>
              <td width="150" height="30" align="right" valign="middle" bgcolor="#FFFFFF" class="lan_bwz" style="padding-right:10px">QQ：</td>
              <td height="30" align="left" valign="middle" bgcolor="#FFFFFF" style="padding-left:10px">
              <input name="guestbook.qq" id="qq" type="text" class="ysqgk_box2" />
                </td>
            </tr>
            <tr>
              <td width="150" height="30" align="right" valign="middle" bgcolor="#FFFFFF" class="lan_bwz" style="padding-right:10px">联系电话：</td>
              <td height="30" align="left" valign="middle" bgcolor="#FFFFFF" style="padding-left:10px"><input name="guestbook.tel" id="tel" type="text" class="ysqgk_box1" />
                <span class="hong_wz">*</span></td>
            </tr>
            <tr>
              <td width="150" height="30" align="right" valign="middle" bgcolor="#FFFFFF" class="lan_bwz" style="padding-right:10px">标题：</td>
              <td height="30" align="left" valign="middle" bgcolor="#FFFFFF" style="padding-left:10px">
              <input name="guestbook.title" id="title" type="text" class="ysqgk_box2" />
                <span class="hong_wz">*</span></td>
            </tr>
            <tr>
              <td width="150" height="30" align="right" valign="middle" bgcolor="#FFFFFF" class="lan_bwz" style="padding-right:10px">留言内容：</td>
              <td height="30" align="left" valign="middle" bgcolor="#FFFFFF" style="padding-left:10px">
              <textarea name="guestbook.content" id="content" cols="30" rows="5"></textarea>
                <span class="hong_wz">(500字以内)*</span></td>
            </tr>
            <tr>
              <td width="150" height="30" align="right" valign="middle" bgcolor="#FFFFFF" class="lan_bwz" style="padding-right:10px">验证码：</td>
              <td height="30" align="left" valign="middle" bgcolor="#FFFFFF" style="padding-left:10px">
              <input type="text" id="validatecode" name="validatecode" class="jzxx_yzm" size=10 maxlength="4" >
<img id="validatecodeImg" src="${contextPath}image.jsp" title="点击重新获取验证码" style="cursor:hand" onclick="this.src='${contextPath}image.jsp?date='+new Date();"/> 
<script>
document.getElementById("validatecodeImg").src="${contextPath}image.jsp?date="+new Date();
</script></td>
            </tr>
            <tr>
              <td height="30" colspan="2" align="center" valign="middle" bgcolor="#FFFFFF"><input type="submit" name="Submit" value="提交留言" />
                <input type="reset" name="Submit2" value="重 置" /> 
                </td>
            </tr>
          </table>
          </form>
<#include "../inc/foot.html"/>

